I have module id and object id, |
Re: Load Module and Object based on their id You need Module edit(string name [,bool disp[, bool silent[, bool loadStandardView]]]) to open the module in exclusive edit mode, and Object object(int absno[,Module m]) to get a handle to the object. Note that the latter does not find filtered objects, hence if you load anything than the standard view then you should turn filtering off after loading the module. A code fragment you could start with could look like this
string yourModuleName = ...
int yourObjectID = ...
string yourAttName = ...
string yourAttValue = ...
Module mod = edit(yourModuleName, true, false, true)
Object obj = object(yourObjectID, mod)
if (!null obj)
{
if (canModify(obj.yourAttName)){obj.yourAttName = yourAttValue}
}
|
Re: Load Module and Object based on their id Peter_Albert - Tue Sep 07 07:57:42 EDT 2010 You need Module edit(string name [,bool disp[, bool silent[, bool loadStandardView]]]) to open the module in exclusive edit mode, and Object object(int absno[,Module m]) to get a handle to the object. Note that the latter does not find filtered objects, hence if you load anything than the standard view then you should turn filtering off after loading the module. A code fragment you could start with could look like this
string yourModuleName = ...
int yourObjectID = ...
string yourAttName = ...
string yourAttValue = ...
Module mod = edit(yourModuleName, true, false, true)
Object obj = object(yourObjectID, mod)
if (!null obj)
{
if (canModify(obj.yourAttName)){obj.yourAttName = yourAttValue}
}
With this I can load object dynamically but if I want to load module also based on it then can you suggest solution. Thanks & Regards, Hardik Shah |
Re: Load Module and Object based on their id SystemAdmin - Tue Sep 07 08:02:44 EDT 2010 and if it is matched then load that module. but in this solution i have to iterate all module, so is there a better solution. Thanks & Regards, Hardik Shah |
Re: Load Module and Object based on their id SystemAdmin - Tue Sep 07 08:08:15 EDT 2010 Ah o.k., I sort of overlooked that you wrote that you only have the unique ID of the module, not its name. In that case you can edit the module with Module mod = edit(fullname itemFromID(moduleID))
given that the ID is stored in the string variable moduleID. |
Re: Load Module and Object based on their id Peter_Albert - Tue Sep 07 08:11:10 EDT 2010 Ah o.k., I sort of overlooked that you wrote that you only have the unique ID of the module, not its name. In that case you can edit the module with Module mod = edit(fullname itemFromID(moduleID))
given that the ID is stored in the string variable moduleID. It works exactly what i wanted... Thanks & Regards, Hardik Shah |